package cn.tedu.service;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;


@Component
@Aspect
public class AspectTest {
    @Pointcut("execution(* cn.tedu.service..*.*(..))")
    public void point(){ }
    @Around("point()")
    public Object doAround(ProceedingJoinPoint joinPoint) throws Throwable{
        long start = System.currentTimeMillis();

        Object o = joinPoint.proceed();

        long end = System.currentTimeMillis();
        System.out.println("aop计算的耗时"+(end-start));
        return o;

    }



}
